<script setup>

import { getBannerListApi } from '@/api/shop.js'
import { onLoad } from '@dcloudio/uni-app'
import { reactive } from 'vue'
const info = reactive({
  bgUrl: ''
})
onLoad(() => {
  init()
})
// 获取轮播列表数据
function init() {
  getBannerListApi({
    position: '5'
  })
    .then(res => {
      // console.log('res', res);
      info.bgUrl = res.data[0].picUrl
      // console.log(info.bannerList)
    })
}
// 前往首页
function goHome() {
  //  存储launchFlag下次不在进入引导页
  uni.setStorage({
    key: 'launchFlag',
    data: true
  });
  uni.switchTab({
    url: '/pages/home/index'
  });
}
</script>
<template>
  <view class="guide-page">
    <up-image :show-loading="true" :src="info.bgUrl" width="100vw" height="100vh"></up-image>
    <view class="btn-box" @click="goHome">
      <image src="/static/images/guide/btn.png" mode="aspectFit" />
    </view>
  </view>
</template>

<style lang="scss" scoped>
.guide-page {
  & .btn-box {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 148rpx;
    text-align: center;

    & image {
      width: 600rpx;
      height: 160rpx;
    }
  }
}
</style>
